//
//  NewsDetailViewController.m
//  Kjs-iOS
//
//  Created by 江伟 on 16/8/24.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "NewsDetailViewController.h"
#import "KJSRequest.h"

#define screenW [[UIScreen mainScreen] bounds].size.width //屏幕宽度
#define screenH [[UIScreen mainScreen] bounds].size.height //屏幕高度
@interface NewsDetailViewController ()
@property (nonatomic,strong) UIWebView *webView;
@end

@implementation NewsDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setTitle:@"平台动态"];
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, screenW, screenH)];
    [self.webView setBackgroundColor:[UIColor whiteColor]];
    self.webView.opaque = NO;
    [self.view addSubview:self.webView];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)viewDidAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self getNewsDetail];
}
#pragma mark - custom method
-(void)getNewsDetail
{
    if (![self.platformId isEqualToString:@""]) {
        [KJSRequest getNewsDetailWithplatformNewsId:self.platformId ret:^(PlatformNewsModel *model) {
            PlatformNews *news = model.platformTrendsList.firstObject;
            [self.webView loadHTMLString:news.content baseURL:nil];
        }];

    }
}

@end
